#include <iostream>

using namespace std;

class Base
{
protected:
    int age;
public:
    Base()
    {
        cout << "Base 的无参构造" << endl;
    }

    Base(int age_) : age(age_)
    {
        cout << "Base 的有参构造" << endl;
    }

    ~Base()
    {
        cout << "Base 的析构函数" << endl;
    }

    int getAge()
    {
        return this->age;
    }
};

class Derive : public Base
{
    Derive()
    {
        cout << "Derive 的无参构造" << endl;
    }

    ~Derive()
    {
        cout << "Derive 的析构函数" << endl;
    }
};

int main()
{
    Derive derive;
    cout << derive.getAge() << endl;
    
    return 0;
}